package com.ruoyi.robot.pojo.dto;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;

/**
 * <p>
 *
 * </p>
 *
 * @author xds
 * @since 2023-01-16
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="Essay对象", description="")
public class EssayDto implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "唯一标识")
    @TableId(value = "essay_id", type = IdType.AUTO)
    private Long essayId;

    @ApiModelProperty(value = "文章标题")
    @NotBlank(message = "文章题目不能为空")
    private String essayTitle;

    @ApiModelProperty(value = "文章内容")
    @NotBlank(message = "文章内容不能为空")
    private String essayContent;

    @ApiModelProperty(value = "文章作者")
    @NotBlank(message = "文章作者不能为空")
    private String essayAuthor;

    @ApiModelProperty(value = "0/1(1置顶)")
    @Min(message = "不可小于0", value = 0L)
    @Max(message = "不可大于1", value = 1L)
    private Integer isTop;

    @ApiModelProperty(value = "封面路径")
    @NotBlank(message = "图片不能为空")
    private String photoUrl;

}
